package com.parking.certified.service;


import com.parking.certified.dto.CertifiedAccountClientDto;
import com.parking.certified.dto.CertifiedAccountDTO;
import com.parking.certified.dto.CertifiedDto;
import com.parking.certified.entity.CertifiedAccount;
import com.baomidou.mybatisplus.extension.service.IService;
import com.parking.certified.form.AddCertifiedForm;
import com.parking.certified.form.CertifiedLoginForm;
import com.parking.certified.form.UpdateStateForm;


import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 彭于晏
 * @since 2023年11月29日
 */
public interface CertifiedAccountService extends IService<CertifiedAccount> {
    /***
     * 平台添加物业
     * @param form 物业账号 certifiedAccountAccount    物业密码 certifiedAccountPass
     * @param adminId
     */
    void addCertified(AddCertifiedForm form, Integer adminId)throws Exception;

    /***
     *  物业登录
     * @param form
     * @param response
     * @return 返回物业信息dto
     */
    CertifiedAccountDTO certifiedLogin(CertifiedLoginForm form, HttpServletResponse response);

    void loginOut(Integer certifiedAccountId);

    /***
     *  查询物业账号
     * @param certifiedAccountId
     * @return 返回物业账号信息
     */
    List<CertifiedAccountDTO> selectCertifiedAccount(Integer certifiedAccountId,Integer platformId);

    /***
     * 平台开启物业状态
     * @param certifiedAccountId
     */
    void enableCertifiedState(Integer certifiedAccountId,Integer platformId);

    /***
     * 平台删除物业
     * @param certifiedAccountId
     * @param platformId
     */
    void deleteCertifiedState(Integer certifiedAccountId,Integer platformId);

    /***
     * 平台禁用物业
     * @param certifiedAccountId
     * @param platformId
     */
    void disableCertifiedState(Integer certifiedAccountId,Integer platformId);

    /**
     * 根据ID查询物业账号
     * 参数: 物业账号Id certifiedAccountId
     * 返回: 物业账号Id certifiedAccountId
     *      物业账号 certifiedAccountAccount
     * 方法: 1.判断certifiedAccountId是否存在对应的物业账号 若不存在则抛异常
     *      2.判断对应的物业账号的状态是否是启用的 若不是则抛异常
     *      3.将物业账号放入Dto返回
     * */
    CertifiedAccountClientDto selectCertifiedAccountById(Integer certifiedAccountId);


    CertifiedDto findCertifiedInfoById(Integer certifiedInfoId);
}
